import java.util.Scanner;
//向上取整
public class code1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        String b = sc.next();
        int sum = 20;
        if(a>1) {//3.7 ->3    3->3
            double other = a - (int) a; //4.7-4 =0.7
            if(other!=0) {
                sum+=1;
            }
            sum += (int)a-1;
        }
        if (b.equals("y")) {
            sum += 5;
        }
        System.out.println(sum);
    }
}
